<div class="pageContent">
    <form method="post" action="${rc.getContextPath()}/manage/workCenter/saveWorkCenter" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
        <div class="pageFormContent nowrap" layoutH="58">
            <fieldset>
                <dl>
                    <dt><@label key="workCenter_type.C,colon">工作中心类型：</@label></dt>
                    <dd>
                        <select name="workCenterTypeCode" class="required">                
                            <option value=""><@label key='selected_first.C'>请选择</@label></option>
                            <#if workTypes??>
                                <#list workTypes as workCenterType>
                                    <option value="${workCenterType.workCenterTypeCode!''}">${workCenterType.typeText!''}</option>
                                </#list>
                            </#if>
                        </select>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="code.C,colon">编码：</@label></dt>
                    <dd>
                        <input name="workCenterCode"  warn="<@label key='code.C,remote.M'>编号已经存在</@label>" size="32" type="text" maxlength="20" class="required alphanumeric toUp" remote="${rc.getContextPath()}/manage/workCenter/isExistsWorkCenter"/>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="parentWorkCenter.C,colon">父级工作中心：</@label></dt>
                    <dd>
                        <input readonly="readonly" value="<#if (parentWorkCenterCode)??>${parentWorkCenterCode!''}</#if>" size="32" type="text"/>
                        <input type="hidden" name="parentWorkCenterCode" value="<#if (parentWorkCenterCode)??>${parentWorkCenterCode!''}</#if>" />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="description.C,colon">描述：</@label></dt>
                    <dd>
                        <input name="workCenterText" value="<#if (workCenter.workCenterText)??>${workCenter.workCenterText!''}</#if>" size="32" maxlength="60" type="text" />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="workCalendar.C,colon">工作日历：</@label></dt>
                    <dd>
                        <select name="calendarCode">                
                            <option value=""><@label key='selected_first.C'>请选择</@label></option>
                            <#if calendars??>
                                <#list calendars as calendar>
                                    <option value="${calendar.calendarCode!''}">${calendar.calendarText!''}</option>
                                </#list>
                            </#if>
                        </select>
                    </dd>
                </dl>
                <dl>
					<dt><@label key="defaultWarehouse.C,colon">默认线边仓库：</@label></dt>
						<dd>				  
						<select  id="mm_warehouseCode" class="allyselect required valid" ref="storageLocation" postField="warehouseCode"  name="warehouseCode" refUrl="${rc.getContextPath()}/manage/warehouse/warehouseChange"
						>
						</select>
						</dd>
				</dl>
				<dl>
					<dt><@label key="defaultStorageLocation.C,colon">默认线边库位：</@label></dt>
			          <dd>
						<select selectedValue="${workCenter.storageLocationCode!''}" id="storageLocation" field="storageLocationCode" name="storageLocationCode" label="storageLocationText" >
						</select>
						</dd>
					</dl>
                <dl>
                    <dt>&nbsp;</dt>
                    <dd>
                        <label><input style="margin-right: 2px;" type="checkbox" name="lockFlag" value="1"<#if (workCenter.lockFlag)?? && (workCenter.lockFlag == 1)> checked="true"</#if>><@label key="lock.C">锁定</@label></label>
                    </dd>
                </dl>
                <dl>
                    <dt>&nbsp;</dt>
                    <dd>
                        <ul>
                            <li><div class="buttonActive">
                                    <div class="buttonContent">
                                        <button type="submit" onclick="save()"><@label key="save.B">保存</@label></button>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </dd>
                </dl>
            </fieldset>
            
        </div>
    </form>
</div>
<script type="text/javascript">
function getWarehouse(){
	$.DWZajax({
        url:hostUrl +"/warehouse/selectWarehouse",
        
        callback:function(data){
            if(data && data.length > 0){
            	
                var options = "";  
                for(var i=0; i<data.length; i++){                  
                        options += "<option value="+data[i].warehouseCode+">"+data[i].warehouseText+"</option>";
                            
                }
                $("select#mm_warehouseCode", navTab.getCurrentPanel()).html(options);
                
            }else{
                $("select#mm_warehouseCode", $.pdialog.getCurrent()).html("");
                       
            }
        }
    });
}
$(function(){
	　　getWarehouse();
	}); 
 
	
</script>
